import datetime
import time
import os

def clear_screen():
    """Clear the terminal screen"""
    os.system('cls' if os.name == 'nt' else 'clear')

def digital_clock():
    """Display a simple digital clock"""
    try:
        while True:
            # Clear the screen
            clear_screen()
            
            # Get current time
            now = datetime.datetime.now()
            
            # Format the time
            current_time = now.strftime("%H:%M:%S")
            current_date = now.strftime("%Y-%m-%d")
            
            # Display the clock
            print("Digital Clock")
            print("=" * 20)
            print(f"Date: {current_date}")
            print(f"Time: {current_time}")
            print("=" * 20)
            print("Press Ctrl+C to exit")
            
            # Wait for 1 second
            time.sleep(1)
    except KeyboardInterrupt:
        print("\nClock stopped")

if __name__ == "__main__":
    digital_clock()